﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Caifu.Fx
{
    public class RequestResult
    {
        /// <summary>
        ///请求结果状态：
        ///20000：请求成功
        ///40000：用户名为空，请求失败
        ///40002：用户密码为空，请求失败
        ///40003：验证码错误，请求失败
        ///40101：用户名错误，请求失败
        ///40102：用户密码错误，请求失败
        ///40500：拒绝该请求方式
        /// </summary>
        private Int32 status = 20000;

        public Int32 Status
        {
            get { return status; }
        }

        /// <summary>
        /// 登陆者邮箱
        /// </summary>
        private String email = String.Empty;

        public String Email
        {
            get { return email; }
        }

        /// <summary>
        /// 登录者临时凭证
        /// </summary>
        private String ticket = String.Empty;

        public String Ticket
        {
            get { return ticket; }
        }

        /// <summary>
        /// 附近信息
        /// </summary>
        private String msg = String.Empty;

        public String Msg
        {
            get { return msg; }
        }

        /// <summary>
        /// 是否开启图片验证码机制
        /// false:不开启
        /// true:开启
        /// </summary>
        private Boolean captcha = false;

        public Boolean Captcha
        {
            get { return captcha; }
            set {
                captcha = value;
            }
        }

        public RequestResult()
        {

        }

        public RequestResult(Int32 status)
        {
            this.status = status;
        }

        public RequestResult(Int32 status, String mail)
            : this(status)
        {
            this.email = mail;
        }

        public RequestResult(Int32 status, String mail, String ticket)
            : this(status, mail)
        {
            this.ticket =ticket;
        }

        public RequestResult(Int32 status, String mail, String ticket, String msg)
            : this(status, mail,ticket)
        {
            this.msg = msg;
        }

        public RequestResult(Int32 status, String mail, String ticket, String msg, Boolean captcha)
            : this(status, mail, ticket,msg)
        {
            this.captcha = captcha;
        }
    }
}
